// 
//  Copyright 2011  Felipe Segade
// 
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
// 
//        http://www.apache.org/licenses/LICENSE-2.0
// 
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

namespace FreeType2Sharp
{
	using System;
	using System.Runtime.InteropServices;
	
	public static class FreeTypeNative
	{
		private const string libname = "libfreetype.so";
		
		[DllImport(libname)]
		public static extern 
			int FT_Init_FreeType (out IntPtr alibrary);
		
		[DllImport(libname)]
		public static extern 
			int FT_Done_FreeType (IntPtr library);
		
		[DllImport(libname)]
		public static extern 
			void FT_Library_Version (IntPtr library, out int amajor, out int aminor, out int apatch);
		
		[DllImport(libname)]
		public static extern 
			int FT_New_Face (IntPtr library, string filepathname, long face_index, out IntPtr aface);

		[DllImport(libname)]
		public static extern 
			int FT_Done_Face (IntPtr aface);

		[DllImport(libname)]
		public static extern 
			int FT_Set_Char_Size (IntPtr face, long char_width, long char_height, uint horz_resolution, uint vert_resolution);

		[DllImport(libname)]
		public static extern 
			int FT_Set_Pixel_Sizes (IntPtr aface, uint pixel_width, uint pixel_height);

		[DllImport(libname)]
		public static extern 
			uint FT_Get_Char_Index (IntPtr aface, ulong charcode);
		
		[DllImport(libname)]
		public static extern 
			int FT_Load_Glyph (IntPtr aface, uint glyph_index, FT_LOAD load_flags);

		[DllImport(libname)]
		public static extern 
			int FT_Render_Glyph (IntPtr slot, FT_Render_Mode render_mode);

		[DllImport(libname)]
		public static extern 
			int FT_Load_Char (IntPtr aface, ulong char_code, FT_LOAD load_flags);

		[DllImport(libname)]
		public static extern 
			int FT_Set_Transform (IntPtr aface, IntPtr matrix, IntPtr delta);
	}
}
